Methods and devices for sending and receiving location information for wireless devices

ABSTRACT

The embodiments herein relate to a method in a first device ( 101 ) for informing a second device ( 105 ) that an identity associated with the first device ( 101 ) is at a certain location. The first device ( 101 ) obtains information about the location of the first device ( 101 ). The first device ( 101 ) broadcasts, by means of device to device, D2D, communication, a message to be received by the second device ( 105 ). The message comprises the location information and an identity information associated with a user of the first device ( 101 ). The location information is transmitted on a first communications resource and the identity information is transmitted on a second communications resource.

TECHNICAL FIELD

Embodiments herein relate generally to a first device, a method in thefirst device, a second device and a method in the second device. Moreparticularly the embodiments herein relate to informing a second devicethat an identity associated with the first device is at a certainlocation.

BACKGROUND

Location aware and localized communication is becoming increasinglyimportant. E.g., services such as Google Latitude, Facebook places etc,enable users to share their locations, and the services will adapt basedupon where the users are located. The services used by the users willrun on User Equipments (UEs). A user equipment is a mobile terminal bywhich a subscriber may access services offered by an operator. The userequipment may be for example communication devices such as mobiletelephones, cellular telephones, smart phones, tablet computers,stationary computers or laptops with wireless capability. The userequipments may be portable, pocket-storable, hand-held,computer-comprised or vehicle-mounted mobile devices, enabled tocommunicate voice and/or data with another entity, such as another userequipment, a server or any other node in a system.

For example, two users, each having a user equipment, may want to benotified when they are in close proximity to one another. This type ofservices will likely gain importance in the future, e.g., in socialmedia and augmented reality applications. Further, besides the socialmedia applications, a multitude of use cases for the proximal Internetwhere the user interacts directly with its surroundings can be imagined.

Device-to-device communication (D2D) is a concept describing thatdevices, typically user equipment's, communicate directly with eachother. Direct communication is here interpreted as communication withoutany intermediate infrastructure. A prerequisite for D2D communication isthat the communicating devices are proximate devices which are aware ofeach other's physical presence. The D2D communication between devicescan be efficient in terms of communication resource usage, energy andbandwidth since the communication does not go via any intermediateinfrastructure. D2D communication uses dedicated communication resourcesor any suitable communications resource which is available in a system.One reason for using the D2D communication is to increase the efficiencyrelating to energy, bit rate, and Quality of Service (QoS) of systems.

In some examples of D2D communication, devices periodically transmitsignals carrying an identity. The identity may also be referred to as anexpression. An identity may depend on a certain user or owner of theuser equipment, a place, an application, etc. For example, the identitymay be tied to a certain group of users on a social media application,such as Facebook, and then identifies a particular user to other membersof this user group. In other words, each member of the user group whichreceives the identity will be able to identify that the usertransmitting the identity is nearby. This type of identities aretypically private, i.e., only interpretable to an intended group ofusers. Identities may also be public and carried by shops, restaurants,buses, taxis, museums, etc. This type of identities may be understood byanyone. The identities may be transmitted to a specific receiver, or itmay be broadcast in the system. As mentioned above, the system refers toa plurality of user equipment's which understands the identities.

The identification of the identities tells listening and authorizedusers that the transmitter of the identity is nearby. The transmitter ofthe identity may be for example a device, a building, a service, etc.

SUMMARY

An object of embodiments herein is therefore to provide improved deviceto device communication.

According to a first aspect, the object is achieved by a method in afirst device for informing a second device that an identity associatedwith the first device is at a certain location. The first device obtainsinformation about the location of the first device. The first devicebroadcasts, by means of device to device, D2D, communication, a messageto be received by the second device. The message comprises the locationinformation and an identity information associated with a user of thefirst device. The location information is transmitted on a firstcommunications resource and the identity information is transmitted on asecond communications resource.

According to a second aspect, the object is achieved by a method in asecond device for being informed by a first device that an identityassociated with the first device is at a certain location. The seconddevice receives, by means of device to device, D2D, communication, amessage broadcast from the first device, wherein the message comprisesthe location information and an identity information associated with auser of the first device. The location information is received on afirst communications resource and the identity information is receivedon a second communications resource.

According to a third aspect, the object is achieved by a first devicefor informing a second device that an identity associated with the firstdevice is at a certain location. The first device comprises an obtainingunit which is configured to obtain information about the location of thefirst device. The first device comprises a broadcasting unit configuredto broadcast by means of device to device, D2D, communication, a messageto be received by the second device. The message comprises the locationinformation and an identity information associated with a user of thefirst device. The location information is transmitted on a firstcommunications resource and the user identity is transmitted on a secondcommunications resource.

According to a fourth aspect, the object is achieved by a second devicefor being informed by a first device that an identity associated withthe first device is at a certain location. The second device comprises areceiving unit which is configured to receive a message broadcast, bymeans of device to device, D2D, communication, from the first device.The message comprises location information and an identity informationassociated with a user of the first device. The location information isreceived on a first communications resource and the user identity isreceived on a second communications resource.

Since the message comprises both the location information and theidentity information associated with the user of the first device,device to device communication is improved.

Embodiments herein afford many advantages, of which a non-exhaustivelist of examples follows:

An advantage of the embodiments herein is that the first devicetransmits the message in an efficient manner and the message is decodedby any or only authorized receivers, i.e. second devices. This enablessoftware on the second device to exploit the location information.

As the location information may be truncated, it provides the advantageof reducing the amount of utilized communication resources in thecommunication link between the first device and the second device.

The embodiments herein are not limited to the features and advantagesmentioned above. A person skilled in the art will recognize additionalfeatures and advantages upon reading the following detailed description.

BRIEF DESCRIPTION OF THE DRAWINGS

The embodiments herein will now be further described in more detail inthe following detailed description by reference to the appended drawingsillustrating the embodiments and in which:

FIG. 1 is a schematic drawing illustrating embodiments of a system.

FIG. 2 is a combined flow chart and block diagram illustratingembodiments of a method.

FIG. 3 is a square grid illustrating embodiments of a method forobtaining location.

FIG. 4 is a flow chart illustrating embodiments of a method in a firstdevice.

FIG. 5 is a block diagram illustrating embodiments of a first device.

FIG. 6 is a flow chart illustrating embodiments of a method in a seconddevice.

FIG. 7 is a block diagram illustrating embodiments of a second device.

FIG. 8 is a block diagram illustrating embodiments of a first device.

FIG. 9 is a block diagram illustrating embodiments of a second device.

The drawings are not necessarily to scale and the dimensions of certainfeatures may have been exaggerated for the sake of clarity. Emphasis isinstead placed upon illustrating the principle of the embodimentsherein.

DETAILED DESCRIPTION

The embodiments herein describe ways of augmenting identity informationwith location information in a message. Location information may also bereferred to as position information. It should be noted that thislocation information may typically be heavily truncated since thereceiver of the message will typically be within short distance, e.g., afew 100 s of meters, from the transmitter of the message and often muchcloser, due to the limitation set by the physical link between thetransmitter and the receiver. It is assumed that the receiver of themessage has approximate information of its own location.

The embodiments herein comprise the following aspects:

1) Augment identity information with location information in a message.

2) Truncate the location information.

In many instances it would be desirable to extend the identityinformation with location information of the transmitter of the messageif this is known to the message transmitter. The receivers of themessage would then be able to know both that the transmitter of themessage is nearby and also its more detailed location.

FIG. 1 depicts a system 100 in which embodiments herein may beimplemented. The system 100 comprises a first device 101 which is in D2Dcommunication with a second device 105. The first device 101 may be auser equipment such as a mobile phone, smart phone, personal digitalassistant (PDA), tablet computer, laptop, MP3 player, portable DVDplayer, digital camera, or even stationary devices such as a PC, it maybe an embedded communication device in e.g. electronic photo frames,cardiac surveillance equipment, intrusion or other surveillanceequipment, weather data monitoring systems, vehicle, car or transportcommunication equipment, it may be any type of transmitter connected toe.g. a bus, a bus stop, a shop, a public place, a movie theater etc.Basically, the first device 101 may be any type of device which has aninterest of announcing “hey, I'm here”. The second device 105 may be auser equipment such as a mobile phone, smart phone, personal digitalassistant (PDA), tablet computer, laptop, MP3 player, portable DVDplayer, digital camera, or even stationary devices such as a PC, it maybe an embedded communication device in e.g. electronic photo frames,cardiac surveillance equipment, intrusion or other surveillanceequipment, weather data monitoring systems, vehicle, car or transportcommunication equipment, etc.

The first device 101 communicates with the second device 105 over awireless communication link 108. The communication link 108 may be basedon any suitable wireless communication protocols such as for exampleWiFi, ZigBee, Wireless Universal Serial Bus (WUSB), Bluetooth,FlashLinQ, future versions of Universal Terrestrial Radio Access Network(UTRAN) or Evolved-Universal Mobile Telecommunications SystemTerrestrial Radio Access (E-UTRA).

The method for informing the second device 105 that an identityassociated with the first device 101 is at a certain location, accordingto some embodiments will now be described with reference to the combinedsignaling diagram and flowchart depicted in FIG. 2. More specifically,the method is for informing the second device 105 that a bearer of theidentity information is at the location. It may also be formulated asfor informing the second device 105 on what identities and associatedlocations associated with the first device 101 are present where in thevicinity of the second device 105. The first device 101 is configured tobroadcast messages to be received by device(s) which are nearby, i.e.the first device 101 and the second device 105 are in proximity or inthe vicinity of each other. This message comprises information about anidentity associated with the user/owner of the first device 101 at acertain location. The identify information provides the receiver of themessage, i.e. the second device 105, with information about thetransmitter, i.e. the first device 101, being near its own location, forexample within a few 100 meters. The term broadcast refers to a methodof transferring a message to all devices in the system. The user of thefirst device 101 may be for example a person, a shop or a restaurant, orany of the examples mentioned earlier. The first device 101 may have oneor more identities to transmit.

The method comprises the following steps, which steps may as well becarried out in another suitable order than described below.

Step 201

The first device 101 determines if its location information should becomprised in the message or not.

The addition of location information in the message requires morecommunication resources, i.e. it involves additional load on the system,albeit typically not very high. The load in the system relates to theamount of transmitted data and is measured in for example spectrumresource utilization, i.e. how large quantity of the available spectrumis used for transmitting the data. The same amount of communicationresources is available but more data needs to be transmitted in thebroadcasting of the message comprising location information. Thus, theload of the system may be a parameter which decides whether appendinglocation information to certain messages is allowed or recommended. Forexample, if the fraction of the available communication resource used(e.g., without taking the additional load by appending the locationinformation into account) is above a certain threshold or percentage,then the location information would not be appended to the message. Thethreshold and percentage may be a predefined parameter in the firstdevice 101. In order to get a stable system, the fraction of theavailable communication resource should disregard the appended locationinformation and only compute the fraction of the available communicationresource which is used for carrying the identity information. Timeaveraging or some other averaging method may also be employed.

In addition, the first device 101 may not always know its own location,or may for some reason not wish to share its location. Then the firstdevice 101 determines that it should not append location information tothe message. If the first device 101 determines that locationinformation should not be comprised in the message, the method proceedsto step 206, indicated by “no” in FIG. 2.

If the first device 101 determines that location information should becomprised in the message, the method proceeds to step 202, indicated by“yes” in FIG. 2.

Step 202

When the first device 101 has determined that the location informationshould be comprised in the broadcast message together with theassociated identity information in step 201, indicated as “yes” in FIG.2, the first device 101 obtains its location.

The location is the geographic location or position of the first device101. The location needs to be given relative to a reference coordinatesystem known to the second device 105. Several references are possible,such as for example the Global Positioning System (GPS) coordinates,Global Navigation Satellite System (GLONAS), the global navigationsatellite system called Galileo or a local coordinate systems such asthe Rikets Nät (RT90) used in Sweden. For example, the location of thefirst device 101 is given using GPS as the reference coordinate system,and may be 57.708611, 11.973056.

The location information may be predefined in the first device 101, orobtained at regular intervals by receiving the location information frome.g. GPS satellites. If the first device 101 is stationary, the locationinformation may be predefined. In another example, where the firstdevice 101 is moving, the location information may be obtained atregular intervals.

The obtained location information is non-truncated, i.e. having fullprecision.

Step 203

The first device 101 determines in which way it shall broadcast themessage comprising the obtained location and the associated identityinformation, i.e. in which way the available communication resourcesshould be utilized to broadcast the message.

There are many possible ways by which the first device 101 couldbroadcast the message. The following parameters are used below:

-   -   location_resource: the spectrum resource which is used to        broadcast the location information comprised in the message;        e.g., an area in a time-frequency grid, a code, a time slot,        etc.    -   identity_resource: the spectrum resource which is used to        broadcast the identity information comprised in the message;        e.g., an area in a time-frequency grid, a code, a time slot,        etc.    -   identity_value: a numerical value of the message which        identifies the user of the first device 101 transmitting the        message. The user of the first device 101 may be for example a        certain user in a certain context, such as a social network user        group, or the user may be a vehicle, a store, a bus stop, a        public library etc. which also may possibly be in the context of        a social network or other type of network, etc.

The message comprises both the location_resource and theidentity_resource. The location information may be comprised in themessage using a fixed location dedicated resource, referred to as afirst communications resource, based on the identity value. One exampleis to calculate a hash function using the identity_value as input. Ahash function is a function that maps large data sets to smaller datasets. The result of the hash function maps the location informationobtained in step 202 to the dedicated communication resource, e.g., alocation in a time-frequency grid, which may be identified based on thevalue of the identity itself. Different identity_values may give thesame location_resource. In other words, a mapping such as:

-   -   location_resource=hash_function(identity_value).

The candidates for location_resource, i.e. possible mappings fromhash_function(.), may be either shared with the regular communicationsresources used for broadcast of the message, they may be a set ofcommunication resources dedicated for location information, or they maybe communication resources that are not dedicated for messages but whichmay be used for other purposes, e.g., transmission of data between thefirst device 101 and the second device 105. These settings may be basedon parameters such as e.g. the system load.

Another example is to comprise the communication resource at which theidentity information is broadcast in the hash function, or possibly onlyuse the identity_resource:

-   -   location_resource=hash_function(identity_value,        identity_resource)    -   or    -   location_resource=hash_function(identity_resource).

The identity_resource may have some degree of randomness, which impliesthat this mapping should avoid successive overlaps of the locationresource between two messages, and different messages will not end upmapping their location information to the same communication resource,which means that they will not interfere.

In another example, the location information in the message may bebroadcast directly in the identity_resource. This may be done byallocating a large enough identity_resource for all messages, i.e., insome sense over-allocating resources for the messages which do notcomprise any identity information.

Another example is to set aside a fraction of the potential values foridentity_value and for those allocate a lower number of bits for theidentity information. For example, if identity_resource may carry nbits, some identity information or instances of identity_value will usen-x bits and use the remaining x bits for the location information. Aprerequisite for this is that it must be decided beforehand if messagemay comprise location information and also reserve a bit sequence of xbits for “location not known or shared”. This does not cause anyoverhead for messages which do not comprise location information.

The identity information is mapped to a second communications resource.

The first communications resource and the second communications resourcemay be different communications resources. Separating the identityinformation and location information in separate communication resourcesprovides a possibility to add the embodiments herein to existing systemswhich is currently only designed for transmitting identity information.Furthermore, it provides a flexible solution in situations where somedevices want to send location information and other devices do not wantto send location information.

In some embodiments, the first communications resource and the secondcommunications resource may be the same communication resources. A setof all possible identities associated with the first device 101 may beset aside and fewer bits are allocated for the identity information. Theother bits, i.e. the freed up bits, are allocated for the locationinformation. The information sent on the second communication resourcemay have a bit which is reserved for indicating whether locationinformation is comprised in the message or not. This bit is detectableby the second device 105.

Step 204

The first device 101 truncates the obtained location information.

Though it would be possible to include the full location coordinates fora location, the amount of data may be very large and to a large extentunnecessary since the location is already known within e.g. hundreds ofmeters due to that the range of D2D communication is limited to a fewhundred meters. It is assumed that the second device 105 knows its ownlocation e.g. via GPS or any other positioning method. One way tocircumvent this is to truncate the data. There are several possibilitiesto do this. One way is to include a predefined set of decimals of theGPS (or similar) coordinates. If for example decimals 3-5 are included alocation with approximately one meter precision is possible within anarea with approximately a 1000 meter side. Another way is to define alocal grid with a predefined relation to the reference coordinatesystem, e.g. by defining an origin at every whole 1000 meter in thereference coordinate system. Yet another way is to give the locationrelative to e.g. every whole 1000 meter in the reference coordinatesystem. For example, the first device 101 says “relative to my closestgrid point, this is my location”. The second device 105 who may hear thefirst device 101 knows that it is near its own location and may uniquelyidentify the referred grid point. The number of bits needed for a givenprecision is discussed later.

Since proximal information is considered, as described in theintroduction to FIG. 2, the receiver of the message will know that thetransmitter is near its own location, say within a few 100 meters. Inthis example, the second device 105 will know that the first device 101is near its own location. This means that the location information maybe heavily truncated before being broadcast. By assuming a square gridof possible location points, the number of bits in the truncatedlocation information may be computed in the following way:nrof_bits=ceil(log 2((floor(2*max_distance/precision))^2))max_distance is the maximum distance between the message transmitter,i.e. the first device 101, and the receiver, i.e. the second device 105,at which one expects that the receiver may successfully decode themessage. precision is a spacing between points in a square grid. ceil isa function which maps a real number to the smallest following integer,and floor is a function which maps a real number to the largest previousinteger. Log 2 is a binary logarithm. A real number is a number thatrepresents a quantity along a continuum, and it may be real number maybe either rational or irrational, algebraic or transcendental and eitherpositive, negative, or zero.

For some exemplary values, using max_distance=1000 meters andprecision=3 meters in the above equation, the nrof_bits becomes 19. Ifprecision=10 meters the nrof_bits becomes 16. The number of bits forcarrying the identify information, referred to as identify_value above,may be, e.g., 64 bits or 128 bits. The nrof_bits for truncated locationinformation is thus typically significantly less than the number of bitswhich are discussed in the context for carrying the identityinformation, so the overhead of appending the location information iscomparatively low.

The truncation of the location information of a first device 101 may beobtained by combining the information of the first device's 101 ownlocation with the knowledge of the precision of location points of asquare grid. FIG. 3 illustrates the square grid. Each square delimitedby bold lines comprises gridpoints. In the case of a square grid, thegrid comprises floor(2*max_distance/precision))^2 number of gridpoints.One of the gridpoints uniquely determines the location of thetransmitter of the message. The x-mark 301 in FIG. 3 illustrates apossible location of the second device 105 listening to messages.

Note that the curvature of the surface of the Earth 305 is low enough sothat the local approximation of the surface as a square is ratherprecise. These squares will in reality be slightly overlapping. Alsonote that the grid need not be made of squares nor may the gridpoints bepoints on a square grid. Other geometries, such as hexagons may be used.Further, height information may be comprised such that the grid would bein three dimensions (3D).

Step 205

If the message is intended to only be understood by authorizedreceivers, the first device 101 encrypts the location information usingan encryption key. The second device 105 has at some earlier point intime been provided with a decryption key corresponding to the encryptionkey. The first device 101 or a third party may have provided the seconddevice 105 with the decryption key. This would typically be done onlyfor a non-public message. If the message is a public message, this stepis not performed. This way, the message may be understood by bothauthorized and non-authorized second devices 105.

Step 206

The first device 101 broadcasts, by means of D2D communication, themessage to be received by the second device 105. The message comprisesthe location and the identity information associated with the user ofthe first device 101.

The first device 101 typically broadcasts the message at regularintervals, e.g. every 6 seconds.

Since the message is broadcast using D2D communication, the messages mayonly reach/travel a certain distance.

As mentioned above, step 206 may be performed directly after step 201when the first device 101 has determined that location informationshould not be comprised in the message. Step 206 may also be performeddirectly after step 205. In that case, the first device 101 determinedin step 201 that the location information should be comprised in themessage together with the identity information.

Step 207

The second device 105, which is nearby the first device 101, listens formessages and receives the broadcast message. The second device 105 isconfigured to listen to D2D messages.

As the message is broadcast using D2D, the second device 105 whichreceives the message, thereby implicitly knows that the first device 101is close. This is because D2D communication is distance limited. Forexample, if the D2D communication is based on Bluetooth the distance mayrange up to 50 meters. In another example where the D2D communication isbased on WiFi the distance range up to 32 meters in indoor locations andup to 95 meters in outdoor locations.

Step 208

The second device 105 detects, in the message, the identity informationassociated with the user of the first device 101 at the secondcommunication resource, and whether the message, i.e., if steps 202-205were executed by the first device 101, comprises location information.The location information is in addition to the information that thefirst device 101 is close. The information that the first device 101 isclose is known by the second device 105 as a result of having receivedthe message. Only devices which are nearby the first device 101 receivethe message, and thereby knows that the first device 101 is close. Thelocation information provides the second device 105 with the exactlocation of the first device 101. The second device 105 may or may notknow its own location to be able to know the exact location of the firstdevice 101.

The second device 105 may detect the location information through thebit in the second communications resource which is reserved forindicating whether location information is in the message or not.

If the second device 105 has detected that the message compriseslocation information, it finds the appropriate communications resourcewhich carries the location information, i.e. it obtains informationabout the first communications resource with carries the locationinformation in the message. The second device 105 does this byperforming similar operations as the first device 101 did in step 203.

Step 209

In this example, the message is a non-public message which is encrypted.The second device 105 is capable for decrypting the encrypted message.In case the second device 105 is a device which is authorized to readthe message, it comprises a decryption key. Once the second device 105has detected that the message comprises location information, providedthe location information was included in the message from the firstdevice 101, and has found the first communication resource carrying thelocation information, it decrypts the location information using thedecryption key. Together with the identity information also comprised inthe message, the second device 105 is able to know that the first device105 is nearby and also it's more detailed location.

Non-authorized receivers may also receive the message, but since they donot have the decryption key, they do not understand the locationinformation.

In case the message is a public message, the second device 105 does notneed to perform any decrypting to be able to read and understand thelocation information.

When the location information is decrypted, the second device 105 readsthe location information of the first device 101.

Step 210

In the case when the location information was truncated by the firstdevice 101, the second device 105 identifies the reference, e.g. GPS,the local coordinate system or the global coordinate system, with whichthe location information is associated. Based on the reference, thesecond device 105 detruncates the truncated location information. Thedetruncated location information thus comprises the full locationcoordinates according to the reference, e.g. 57.708611, 11.973056 usingGPS as the reference coordinate system.

The method described above will now be described seen from theperspective of the first device 101. FIG. 4 is a flowchart describingthe present method in the first device 101, for informing the seconddevice 105 that the identity associated with the first device 101 is ata certain location. The method comprises the further steps to beperformed by the first device 101, which steps may be taken in anysuitable order:

Step 401

This step corresponds to step 201 in FIG. 2.

In some embodiments, the first device 101 identifies the amount ofavailable communications resources for the broadcasting of the message.

The first device 101 may know that, e.g., only some time slots orsimilar resources should be used for broadcasting this type of messages.This knowledge may, e.g. be provided from a network to which the firstdevice 101 is connected.

Step 402

This step corresponds to step 201 in FIG. 2, and is a step followingstep 401.

In some embodiments, the first device 101 determines that the locationinformation should be comprised in the message together with theidentity information only when the identified amount of availablecommunications resources is above a threshold. E.g. if the threshold is50% of the available communications resources, then the locationinformation is comprised in the message only when more than 50% of theresources are available.

Step 403

This step corresponds to step 202 in FIG. 2.

The first device 101 obtains information about the location of the firstdevice 101. The location is a geographical location, and may also bereferred to as a position. The obtained location information isnon-truncated, i.e. having full precision.

The obtained location information is associated with a reference knownto the first device 101 and the second device 105.

In some embodiments, the reference is associated with a globalpositioning system, referred to as GPS, a local coordinate system or aglobal coordinate system.

Step 404

This step corresponds to step 204 in FIG. 2.

In some embodiments, the first device 101 obtains a number of data bits,e.g. 16 or 19 bits, based on a coverage distance of the broadcasting ofthe message and a predefined precision of the location information. Thepredefined precision may be for example 1 m or 10 m. The coveragedistance may be for example an estimated value for at what maximumdistance the D2D messages may be received, based, e.g., on device powerlevels, antenna gains, and propagation environment. Referring to step204 where the dependency between the nrof bits and the grid spacing andthe maximum range of the message. The nrof bits increases when the gridspacing and the maximum range increases. High precision is associatedwith large grid spacing. Grid spacing is the invers of locationprecision.

The number of data bits may be obtained via control signaling, or it maybe predefined in the first device 101 by configuration, i.e. bysignaling from the system.

In some embodiments, the number of bits may be predefined if the sameprecision is always desired. In some embodiments, the precision dependson the load of the system, or it depends on the environment. Forexample, in a rural area a precision of 20 m or so may be acceptablesince it will be easier to find the location. In a city or an indoorlocation a finer precision may be desired. For example a cellularnetwork may control the broadcasting of these messages and may adapt theprecision, implicitly the number of data bits, or it may explicitlyadapt the number of data bits directly, based on parameters such asmentioned above.

Step 405

This step corresponds to step 204 in FIG. 2, and is a step followingstep 404.

In some embodiments, the first device 101 truncates the locationinformation to the obtained number of bits. An example of the number ofbits is described in relation to step 204 above.

Step 406

This step corresponds to step 203 in FIG. 2.

In some embodiments, the first device 101 evaluates a function based onone or both of the identity information and the second communicationsresource.

The function may be a hash function. A modulo function may be used as anexample. The modulo function finds the remainder of division of onenumber by another. If there are M possible communications resourceswhich may be used for the location information, then the hash functionmay be “input modulo M” which returns a value which is one of 0, 1, 2, .. . , M−1, where each value points to a unique communications resourceof the M communications resources.

Step 407

This step corresponds to step 203 in FIG. 2, and is a step followingstep 406.

In some embodiments, the first device 101 determines the firstcommunication resource based on a result of the evaluated function. Inother words, the first device 101 determines which spectrum resourceswill be used for carrying the location information. The result of theevaluated function may be directly associated with the firstcommunications resource, as described in step 406.

Step 408

This step corresponds to step 203 in FIG. 2, and is a step followingstep 407.

In some embodiments, the first device 101 maps the location informationto the determined first communications resource.

Step 409

This step corresponds to step 205 in FIG. 2.

In some embodiments, the first device 101 determines that the locationinformation should be encrypted such that it may be decrypted by thesecond device 105 only if the second device 105 is authorized to readthe location information. In other words, the first device 101determines that only authorized receivers of the message should be ableto understand the message.

Step 410

This step corresponds to step 205 in FIG. 2, and is a step followingstep 409.

In some embodiments, the first device 101 encrypts the locationinformation by using the encryption key. The encryption key ispredefined in the first device 101.

Step 411

This step corresponds to step 206 in FIG. 2.

The first device 101 broadcasts, by means of D2D communication, themessage to be received by the second device 105. The message comprisesthe location information and the identity information associated withthe user of the first device 101. The location information istransmitted on the first communications resource and the identityinformation is transmitted on the second communications resource, andthus the second device 105 is informed that an identity associated withthe first device 101 is at a certain location.

The identify information may be the parameter identity_value asdescribed above. In this case, the identity_value is a number which hasa meaning to the second device 105 receiving the message. In the seconddevice 105 which receives the message there is a mapping from theidentity value to a certain meaning e.g. in an application e.g.Facebook. An identity may depend on a certain user or owner of the userequipment, a place, an application, etc. For example, the identity maybe tied to a certain group of users on a social media application, suchas Facebook, and then identifies a particular user to other members ofthis user group.

The broadcasting is typically performed at regular intervals.

In some embodiments, the location information comprised in the messageis the truncated location information.

In some embodiments, the location information comprised in the messageis the encrypted location information.

In some embodiments, the first communications resource and the secondcommunications resource is the same communications resource.

In some embodiments, the second communications resource comprises anindication indicating that the message comprises the locationinformation. The indication may be a bit where a 1 indicates that themessage comprises the location information, and a 0 indicates that themessage does not comprise the location information.

To perform the method steps shown in FIG. 4 for informing the seconddevice 105 that an identity associated with the first device 101 is at acertain location the first device 101 comprises an arrangement as shownin FIG. 5.

The first device 101 comprises an obtaining unit 501 which is configuredto obtain information about the location of the first device 101. Insome embodiments, the obtaining unit 501 is further configured to obtainthe number of data bits based on the coverage distance of the messageand the predefined precision of the location information. In someembodiments, the obtained location information is associated with thereference predefined in the first device 101 and second device 105. Insome embodiments, the reference is associated with the globalpositioning system, referred to as GPS, the local coordinate system orthe global coordinate system. In the example where the reference isassociated with GPS, the obtaining unit 501 is a GPS receiver.

The first device 101 comprises a broadcasting unit 502 which isconfigured to broadcast by means of D2D communication, the message to bereceived by the second device 105. The message comprises the locationinformation and the identity information associated with the user of thefirst device 101. The location information is transmitted on the firstcommunications resource and the user identity is transmitted on thesecond communications resource. In some embodiments, the secondcommunications resource comprises the indication indicating that themessage comprises the location information. In some embodiments, thefirst communications resource and the second communications resource isthe same communications resource. In some embodiments, the locationinformation comprised in the message is the truncated locationinformation. In some embodiments, the location information comprised inthe message is the encrypted location information.

In some embodiments, the first device 101 comprises an evaluating unit503 configured to evaluate the function based on one or both of theidentity information and the second communications resource.

In some embodiments, the first device 101 comprises a mapping unit 504configured to map the location information to the determined firstcommunications resource.

In some embodiments, the first device 101 comprises a truncating unit505 configured to truncate the location information to the obtainednumber of bits. In some embodiments, the number of data bits ispredefined in the first device 101.

In some embodiments, the first device 101 comprises an identifying unit506 which is configured to identify the amount of availablecommunications resources for the broadcasting of the message,

In some embodiments, the first device 101 comprises a determining unit507 which is configured to determine the first communication resourcebased on the result of the evaluated function. In some embodiments, thedetermining unit 507 is configured to determine that the locationinformation should be comprised in the message only when the amount ofavailable communications resources is above the threshold. In someembodiments, the determining unit 507 is configured to determine thatthe location information should be encrypted such that it may bedecrypted by the second device 105.

In some embodiments, the first device 101 comprises an encrypting unit508 configured to encrypt the location information by using theencryption key known to the first device 101.

The method described above will now be described seen from theperspective of the second device 105. FIG. 6 is a flowchart describingthe present method in the second device 105 for being informed by thefirst device 101 that the identity associated with the first device 101is at a certain location. The method comprises the further steps to beperformed by the second device 105 which steps may be taken in anysuitable order:

Step 601

This step corresponds to step 207 in FIG. 2.

The second device 105 receives, by means of D2D communication, themessage broadcast from the first device 101. The message comprises thelocation information and the identity information associated with theuser of the first device 101. The location information is received onthe first communications resource and the identity information isreceived on the second communications resource.

In some embodiments, the location information comprised in the messageis truncated based on coverage distance of the broadcasting of themessage and the predefined precision of the location information.

In some embodiments, the location information is associated with thereference predefined in the second device 105 and the first device 101.In some embodiments, the reference is associated with the globalpositioning system, referred to as GPS, the local coordinate system orthe global coordinate system.

In some embodiments, the first communications resource and the secondcommunications resource is the same communications resource.

Step 602

This step corresponds to step 208 in FIG. 2.

In some embodiments, the second device 105 detects that the messagecomprises the location information. In other words, the second device105 is able to identify the cases for which it should look for locationinformation.

Step 602 a

This is a substep of step 602.

In some embodiments, the second device 105 detects an indicationindicating that the message comprises the location information. Theindication is comprised in the second communications resource. Theindication may be a bit which is reserved in the second communicationsresource for indicating whether location information is comprised ornot.

Step 603

This step corresponds to step 208 in FIG. 2, and a step which followsstep 602 or 602 a.

In some embodiments, the second device 105 evaluates the function basedon one or both of the identity information and the second communicationsresource when the location information is detected.

Step 604

This step corresponds to step 208 in FIG. 2, and a step which followsstep 603.

In some embodiments, the second device 105 determines the firstcommunications resource based on the result of the evaluated function.In other words, if the second device 105 has detected that the messagecomprises location information, it finds the appropriate communicationsresource which carries the location information, i.e. it obtainsinformation about the first communications resource with carries thelocation information in the message. The second device 105 does this byperforming similar operations as the first device 101 did in step 203.

Step 605

This step corresponds to step 208 in FIG. 2, and a step which followsstep 604.

In some embodiments the second device 105 identifies that the locationinformation is mapped to the determined first communications resource

Step 606

This step corresponds to step 209 in FIG. 2.

In some embodiments, the second device 105 decrypts the locationinformation using the decryption key associated with the encryption key.The location information in the message may be encrypted by the firstdevice 101 using the encryption key.

Step 607

This step corresponds to step 210 in FIG. 2.

In some embodiments, the second device 105 identifies the reference,e.g. GPS, the local coordinate system or the global coordinate system,with which the location information is associated.

Step 608

This step corresponds to step 210 in FIG. 2 and is performed after step607.

In some embodiments, the second device 105 detruncates the truncatedlocation information based on the identified reference. The detruncatedlocation information thus comprises the full location coordinatesaccording to the reference.

To perform the method steps shown in FIG. 6 for being informed by afirst device 101 that the identity associated with the first device 101is at a certain location the second device 105 comprises an arrangementas shown in FIG. 7.

The second device 105 comprises a receiving unit 701 which is configuredto receive the message broadcast, by means of D2D communication, fromthe first device 101. The message comprises location information and theidentity information associated with the user of the first device 101.The location information is received on the first communicationsresource and the user identity is received on the second communicationsresource. In some embodiments, the location information comprised in themessage is truncated based on coverage distance of the broadcasting ofthe message and a predefined precision of the location information. Insome embodiments, the location information is associated with thereference predefined in the second device 105 and the first device 101.In some embodiments, the reference is associated with the globalpositioning system, referred to as GPS, the local coordinate system orthe global coordinate system. In some embodiments, the firstcommunications resource and the second communications resource is thesame communications resource.

In some embodiments, the second device 105 comprises a detecting unit703 which is configured to detect that the message comprises thelocation information. In some embodiments, the detecting unit 703 isfurther configured to detect the indication indicating that the messagecomprises the location information. The indication is comprised in thesecond communications resource.

In some embodiments, the second device 105 further comprises anevaluating unit 705 configured to evaluate the function based on one orboth of the identity information and the second communications resource.

In some embodiments, the second device 105 further comprises adetermining unit 708 configured to determine the first communicationsresource based on the result of the evaluated function.

In some embodiments, the second device 105 further comprises anidentifying unit 710 configured to identify that the locationinformation is mapped to the determined first communications resource.In some embodiments, the identifying unit 710 is further configured toidentify the reference with which the location information isassociated.

In some embodiments, the location information in the message isencrypted by the first device 101 using the encryption key known to thefirst device 101, and the second device 105 further comprises adecrypting unit 712 which is configured to decrypt the locationinformation using the decryption key associated with the encryption key.

In some embodiments, the second device 105 further comprises aprocessing unit 720 configured to detruncate the truncated locationinformation based on the identified reference.

The present mechanism for informing a second device 105 that theidentity associated with the first device 101 is at a certain locationmay be implemented through one or more processors, such as a processingunit 510 in the first device 101 depicted in FIG. 5 and the processingunit 720 in the second device 105 depicted in FIG. 7, together withcomputer program code for performing the functions of the embodimentsherein. The processor may be for example a Digital Signal Processor(DSP), Application Specific Integrated Circuit (ASIC) processor,Field-programmable gate array (FPGA) processor or micro processor. Theprogram code mentioned above may also be provided as a computer programproduct, for instance in the form of a data carrier carrying computerprogram code for performing the embodiments herein when being loadedinto the first device 101 and/or second device 105. One such carrier maybe in the form of a CD ROM disc. It is however feasible with other datacarriers such as a memory stick. The computer program code mayfurthermore be provided as pure program code on a server and downloadedto the first device 101 and/or second device 105 remotely.

Some example implementations of the embodiments illustrated above willnow be described. The example system may further include any additionalelements suitable to support communication between the first device 101and the second device 105. Although the illustrated first device 101 mayrepresent a device that include any suitable combination of hardwareand/or software, this first device 101 may, in particular embodiments,represent a device such as the example first device 101 illustrated ingreater detail by FIG. 8. As shown in FIG. 8, the example first device101 comprises processing circuitry 810, a memory 830, radio circuitry850, and at least one antenna 860. The radio circuitry 850 may compriseRadio Frequency (RF) circuitry and baseband processing circuitry (notshown). In particular embodiments, some or all of the functionalitydescribed above may be provided by the processing circuitry 820executing instructions stored on a computer-readable medium, such as thememory 830 shown in FIG. 8. The processing circuitry 820 illustrated inFIG. 8 corresponds to the processing unit 510 illustrated in FIG. 5.Alternative embodiments of the first device 101 may comprise additionalcomponents beyond those shown in FIG. 8 that may be responsible forproviding certain aspects of the first device's 101 functionality,comprising any of the functionality described above and/or anyfunctionality necessary to support the embodiments described above.

As shown in FIG. 9, the example second device 105 comprises processingcircuitry 920, a memory 930, radio circuitry 950, and at least oneantenna 960. The processing circuitry 920 may comprise RF circuitry andbaseband processing circuitry (not shown). In particular embodiments,some or all of the functionality described above may be provided by theprocessing circuitry 920 executing instructions stored on acomputer-readable medium, such as the memory 930 shown in FIG. 9. Theprocessing circuitry 920 illustrated in FIG. 9 corresponds to theprocessing unit 720 illustrated in FIG. 7 and the antenna 960illustrated in FIG. 9 corresponds to the receiving unit 701 illustratedin FIG. 7. Alternative embodiments of the second device 105 may compriseadditional components responsible for providing additionalfunctionality, including any of the functionality identified aboveand/or any functionality necessary to support the embodiments describedabove.

The embodiments herein are not limited to the above describedembodiments. Various alternatives, modifications and equivalents may beused. Therefore, the above embodiments should not be taken as limitingthe scope of the embodiments, which is defined by the appending claims.

It should be emphasized that the term “comprises/comprising” when usedin this specification is taken to specify the presence of statedfeatures, integers, steps or components, but does not preclude thepresence or addition of one or more other features, integers, steps,components or groups thereof. It should also be noted that the words “a”or “an” preceding an element do not exclude the presence of a pluralityof such elements.

It should also be emphasized that the steps of the methods defined inthe appended claims may, without departing from the embodiments herein,be performed in another order than the order in which they appear in theclaims.

The invention claimed is:
 1. A method in a first device for informing asecond device that an identity associated with the first device is at acertain location, the method comprising: obtaining information about thelocation of the first device; determining a second communicationsresource using a hash function, wherein the hash function has as inputan identifier of a first communications resource; and broadcasting, viaa device to device (D2D) communication, a message to be received by thesecond device, wherein the message includes the location information andidentity information that identifies a user of the first device, andwherein the identity information is transmitted on the firstcommunications resource and the location information is transmitted onthe second communications resource.
 2. The method of claim 1, furthercomprising: obtaining a number of data bits based on a coverage distanceof the broadcasting of the message and based on a predefined precisionof the location information; and truncating the location information tothe obtained number of bits by discarding one or more most significantbits of the location information until the truncated locationinformation has the obtained number of bits; and wherein the locationinformation comprised in the message is the truncated locationinformation.
 3. The method of claim 2, wherein the number of data bitsis predefined in the first device.
 4. The method of claim 1, wherein theobtained location information is associated with a reference known tothe first device and the second device.
 5. The method of claim 4,wherein the reference is associated with a global positioning system,referred to as GPS, a local coordinate system or a global coordinatesystem.
 6. The method of claim 1, further comprising: identifying anamount of available communications resources for the broadcasting of themessage; and determining that the location information should beincluded in the message only when the identified amount of availablecommunications resources is above a threshold.
 7. The method of claim 1,further comprising: determining that the location information should beencrypted such that it can be decrypted by the second device; encryptingthe location information by using an encryption key known to the firstdevice; and wherein the location information included in the message isthe encrypted location information.
 8. The method of claim 1, whereinthe first communications resource comprises an indication indicatingthat the message includes the location information.
 9. The method ofclaim 1, wherein the first communications resource and the secondcommunications resource are the same communications resource.
 10. Themethod of claim 1, wherein the first communications resource and thesecond communications resource are different communications resources.11. The method of claim 1, wherein the hash function is a hash functionof both the identity information and the first communications resource.12. The method of claim 11, wherein the first communications resourceused to determine the second communications resource corresponds to atleast one of an area in a time-frequency grid, a code, and a time slotof spectrum used by the first communication resource.
 13. A method in asecond device for being informed by a first device that an identityassociated with the first device is at a certain location, the methodcomprising: receiving, via a device to device (D2D) communication, afirst portion of a message broadcast from the first device, wherein thefirst portion of the message includes identity information thatidentifies a user of the first device, wherein the identity informationis received on a first communications resource; determining the secondcommunications resource using a hash function, wherein the hash functionhas as input an identifier of the first communications resource;identifying that the location information is mapped to the determinedsecond communications resource; and receiving, via a device to device(D2D) communication, a second portion of the message broadcast from thefirst device, wherein the second portion of the message includesinformation about the location of the first device, wherein the locationinformation is received on the second communications resource.
 14. Themethod of claim 13, further comprising detecting that the messageincludes the location information.
 15. The method of claim 14, whereinthe detecting that the message includes the location information furthercomprises: detecting an indication indicating that the message includesthe location information, wherein the indication is comprised in thefirst communications resource.
 16. The method of claim 13, wherein thelocation information in the message is encrypted by the first deviceusing an encryption key known to the first device, and wherein themethod further comprises decrypting the location information using adecryption key associated with the encryption key.
 17. The method ofclaim 13, wherein the location information included in the message istruncated based on a coverage distance of the broadcasting of themessage and a predefined precision of the location information, saidtruncated location information having most significant bits of originallocation information omitted.
 18. The method of claim 13, wherein thelocation information is associated with a reference predefined in thesecond device and the first device.
 19. The method of claim 18, whereinthe reference is associated with a global positioning system, referredto as GPS, a local coordinate system or a global coordinate system. 20.The method of claim 18, further comprising: identifying the referencewith which the location information is associated; and detruncating thetruncated location information, based on the identified reference, byadding most significant bits to the truncated location information. 21.The method of claim 13, wherein the first communications resource andthe second communications resource are the same communications resource.22. The method of claim 13, wherein the hash function is a hash functionof both the identity information and the first communications resource.23. A first device for informing a second device that an identityassociated with the first device is at a certain location, the firstdevice comprising: an obtaining unit configured to obtain informationabout the location of the first device; a determining unit configured todetermine a second communications resource using a hash function,wherein the hash function has as input an identifier of a firstcommunications resource; and a broadcasting unit configured to broadcastvia a device to device (D2D) communication, a message to be received bythe second device, wherein the message includes the location informationand identity information that identifies a user of the first device, andwherein the identity information is transmitted on the firstcommunications resource and the location information is transmitted onthe second communications resource.
 24. The first device of claim 23,wherein the obtaining unit is further configured to obtain a number ofdata bits based on a coverage distance of the message and a predefinedprecision of the location information; and wherein the first devicefurther comprises: a truncating unit configured to truncate the locationinformation to the obtained number of bits by discarding one or moremost significant bits of the location information until the truncatedlocation information has the obtained number of bits; and wherein thelocation information included in the message is the truncated locationinformation.
 25. The first device of claim 24, wherein the number ofdata bits is predefined in the first device.
 26. The first device ofclaim 23, wherein the obtained location information is associated with areference predefined in the first device and second device.
 27. Thefirst device of claim 26, wherein the reference is associated with aglobal positioning system, referred to as GPS, a local coordinate systemor a global coordinate system.
 28. The first device of claim 23, furthercomprising: an identifying unit configured to identify an amount ofavailable communications resources for the broadcasting of the message;and a determining unit configured to determine that the locationinformation should be included in the message only when the amount ofavailable communications resources is above a threshold.
 29. The firstdevice of claim 23, further comprising: a determining unit configured todetermine that the location information should be encrypted such that itcan be decrypted by the second device; and an encrypting unit configuredto encrypt the location information by using an encryption key known tothe first device; and wherein the location information included in themessage is the encrypted location information.
 30. The first device ofclaim 23, wherein the first communications resource comprises anindication indicating that the message includes the locationinformation.
 31. The first device of claim 23, wherein the firstcommunications resource and the second communications resource are thesame communications resource.
 32. The first device of claim 23, whereinthe hash function is a hash function of both the identity informationand the first communications resource.
 33. A second device for beinginformed by a first device that an identity associated with the firstdevice is at a certain location, the second device comprising: areceiving unit configured to receive a message broadcast via a device todevice (D2D) communication, from the first device, wherein the messageincludes information about the location of the first device and identityinformation that identifies a user of the first device, wherein theidentity information is received on a first communications resource andthe location information is received on a second communicationsresource; a determining unit configured to determine the secondcommunications using a hash function, wherein the hash function has asinput an identifier of the first communications resource; and anidentifying unit configured to identify that the location information ismapped to the determined second communications resource.
 34. The seconddevice of claim 33, further comprising: a detecting unit configured todetect that the message includes the location information.
 35. Thesecond device of claim 34, wherein the detecting unit is furtherconfigured to detect an indication indicating that the message includesthe location information, wherein the indication is comprised in thefirst communications resource.
 36. The second device of claim 33,wherein the location information in the message is encrypted by thefirst device using an encryption key known to the first device, andwherein the second device further comprises: a decrypting unitconfigured to decrypt the location information using a decryption keyassociated with the encryption key.
 37. The second device of claim 33,wherein the location information comprised in the message is truncatedbased on coverage distance of the broadcasting of the message and adesired precision of the location information, said truncated locationinformation having most significant bits of original locationinformation omitted.
 38. The second device of claim 33, wherein thelocation information is associated with a reference predefined in thesecond device and the first device.
 39. The second device of claim 38,wherein the reference is associated with a global positioning system,referred to as GPS, a local coordinate system or a global coordinatesystem.
 40. The second device of claim 38, further comprising: anidentifying unit configured to identify the reference with which thelocation information is associated; and a processing unit configured todetruncate the truncated location information, based on the identifiedreference, by adding most significant bits to the truncated locationinformation.
 41. The second device of claim 33, wherein the firstcommunications resource and the second communications resource are thesame communications resource.
 42. The first device of claim 33, whereinthe hash function is a hash function of both the identity informationand the first communications resource.